from pylab import *

def compare_curve(ax, x, cond_vals):
    for label,vals in cond_vals:
        ax.plot(x, vals, '--o')
        for px,py in zip(x,vals):
            ax.text(px,py,py, verticalalignment="bottom", horizontalalignment="left")
                    
    labels = [label for label, values in cond_vals]
    ax.legend( labels, "upper right", shadow=True )
    ax.grid(True)

    

    
x = range(4)
y1 = ("small", [1,2.5,3.0,4.7])
y2 = ("medium", [2,2.7,3.1,5.8])
y3 = ("huge", [4,3.2,4.8,5.9])

fig, ax = subplots(2)
compare_curve(ax[0], x, [y1,y2,y3])
ax[0].set_xlim(min(x)-0.3, max(x)+1)
show()
